package cn.ellacat.game.guess;

import lombok.Getter;
import lombok.Setter;

/**
 * @author wjc133
 */
@Getter
@Setter
public class Card implements Comparable<Card> {

    /**
     * 卡片颜色
     */
    private CardColor color;
    /**
     * 卡片类型
     */
    private CardType type;
    /**
     * 值
     */
    private int number;
    /**
     * 值是否被隐藏
     */
    private boolean hidden = true;

    @Override
    public int compareTo(final Card c) {
        if (this.number == c.number) {
            return CardColor.compare(this.color, c.color);
        }
        return this.number - c.number;
    }

    @Override
    public String toString() {
        return this.color + ":" + this.type + ":" + this.number;
    }
}
